<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<link href="css/kftp.css" type="text/css" rel="stylesheet" />
<title>客服弹屏</title>
<style>
*{box-sizing: border-box; font-family:"PingFang SC",'HanHei SC',"Lantinghei SC","Open Sans",Arial,"Hiragino Sans GB","Microsoft YaHei","\5FAE\8F6F\96C5\9ED1",STHeiti,"WenQuanYi Micro Hei",SimSun,sans-serif;}
html{ height:100%;}
html,body{ min-width:1300px; width:100%; margin:0 auto; padding:0; top:0; left:0; background:#fff}
body{ font-family:"PingFang SC",'HanHei SC',"Lantinghei SC","Open Sans",Arial,"Hiragino Sans GB","Microsoft YaHei","\5FAE\8F6F\96C5\9ED1",STHeiti,"WenQuanYi Micro Hei",SimSun,sans-serif;  margin:0 auto; padding:20px}
a{ text-decoration:none; text-align:center}
div{ overflow:hidden}
img{ width:100%}
table{ border-collapse:collapse}
th{ font-weight:normal}



.title{ border-bottom:1px solid #999; padding:0 0 10px 10px; font-weight:bold; font-size:20px}
.btn{ border:1px solid #307ECC; border-radius:5px; color:#307ECC; cursor:pointer;}
.btn:hover{ background:#307ECC; color:#fff}
.btn1{ padding:5px 10px; float:right; margin-left:10px; font-size:16px;}
.selbtn1{ background:#307ECC; color:#fff}
.baseInfmt{ font-size:13px; width:49%; float:left; border:1px solid #999; margin-top: 15px;}
.baseInfmt td{ padding:10px}

.con{ margin:10px auto;}
.tab{ height:40px; overflow:visible}
.btn2{ height:41px; line-height:41px; display:inline-block; border:solid #999; border-width:1px; background:#f4f4f8; color:#333; cursor:pointer; padding:0 15px; opacity:.6}
.selbtn2{ background:#fff; border-width:1px 1px 0 1px; font-weight:bold; color:#307ECC; opacity:1}
.order,.history{ border:1px solid #999; min-height:300px; padding:15px;}

.shopAd{ width:30%; height:270px; border:1px solid #b2b2b2; float:left}
.title2{ height:40px; line-height:40px; font-size:14px; background:#f4f4f8; text-align:center; border-bottom:1px solid #b2b2b2; font-weight:bold}
.saSearch{ margin:10px auto; padding:0 10px;}
.sAd{ width:50%; height:30px; padding:0 5px; border:1px solid #b2b2b2;}
.btn3{ font-size:14px; padding:4px 10px; height:30px; margin-left:10px}
.adList{ border-top:1px solid #b2b2b2; height:180px; overflow-y:auto}
.adcon{ font-size:12px; height:45px; padding:5px; border-bottom:1px solid #f2f2f2}
.selAd{ background:#f2f2f2}
.admsg{ width:80%; float:left}
.adbtn{ width:20%; float:right; height:35px; line-height:35px; text-align:center; font-size:14px; color:#307ECC; cursor:pointer}

.goodsBox{ width:67%; height:270px; float:right; border:1px solid #b2b2b2;}
.title3{ float:left; width:50%; cursor:pointer}
.selT3{ background:#fff; border:0;}
.t3box{ width:100%; height:230px; padding:10px; overflow-y:auto}
.tbbox{ width:100%; font-size:13px}
.tbbox th,.tbbox td{ padding:5px}

.addGoods,.payCon{ width:100%; border:1px solid #b2b2b2; margin:15px auto}
.addSearch{ padding:10px; line-height:40px; font-size:13px; overflow:visible}
.addSearch input,.addSearch select{ border:1px solid #b2b2b2; padding:0 5px; display:inline-block; width:100px; height:30px; font-size:13px;}
.addSearch input{ width:200px}
.addSearch span{ margin-right:20px;}
.key{ width:200px; height:30px; display:inline-block; position:relative; margin-bottom:-10px}
.keylist,.words{ width:100%}
.keylist{ position:absolute; height:30px}
/*.key:hover .keylist{ height:auto}*/
.words{ height:30px; line-height:20px; padding:5px; background:#fff; border:solid #b2b2b2; border-width:0 1px 1px 1px; word-break:keep-all; text-overflow:ellipsis;}
.words:hover{ background:#f2f2f2}
#goodsList input,#shopcar input{ width:50px; text-align:center}
#goodsList select,#shopcar select{ width:100px}
#goodsList th,#shopcar th{ border:1px solid #f2f2f2}
#goodsList tbody th,#shopcar tbody th{ height:30px}
#goodsList tfoot th,#shopcar tfoot th{ font-weight:bold; background:#f4f4f8; border: solid #b2b2b2; border-width:1px 0}
.goodsName,.storeName{ height:20px; line-height:20px; word-break:keep-all; text-overflow:ellipsis;}
.goodsName{ width:200px; margin:0 auto}
.storeName{ width:120px;}
.buyCon{ padding:15px; font-size:13px; text-align:right}
.selStore{ margin:0 50px}

#payCon .conTit{ width:10%; text-align:right; font-weight:bold; padding:10px}
#payCon input{ width:100%}
#payCon select{ width:45%}

.sure{ padding:15px; border-top:1px solid #b2b2b2; text-align:right; font-size:14px; font-weight:bold}

.h_search{ width:300px; height:40p; line-height:40px; padding:0 10px;}
.h_table{ width:100%; margin-top:30px}
.h_table tr:hover{ background:#f4f4f8}
.h_table th{ padding:5px 10px; font-size:14px; border:1px solid #ccc;}
thead th{ background:#f4f4f8; font-weight:bold}
.look{ color:#307ECC; cursor:pointer}

#likeGoods,#map{ position:fixed; width:500px; max-height:350px; top:50%; left:50%; margin-top:-150px; margin-left:-250px; background:#fff; border:1px solid #b2b2b2; border-radius:10px; display:none}
#closeLG,#closeMap,#sureAD{ float:right; width:100px; margin:10px; text-align:center}
.lGTb{ border-bottom:1px solid #b2b2b2; overflow-y:auto; max-height:250px;}
#map{ width:700px; max-height:500px; margin-top:-250px; margin-left:-350px; /*box-shadow:0 0 5px #aaa*/}
#allmap{ height:428px}

.orderConTr{ display:none}
.orderCon{ padding:10px; border:1px solid #b2b2b2}
.oCTitList{ border-bottom:1px solid #b2b2b2}
.oCTit{ text-align:center; font-size:13px; width:100px; float:left; border-top:2px solid #fff; cursor:pointer;}
.oCTit:hover{ color:#307ECC}
.seloCTit{ border-top:2px solid #307ECC; color:#307ECC}
.orderCon table{ font-size:12px; width:100%}
.orderCon table td{ text-align:left; padding:5px}

.copy,.buy,.like,.del,.likeGoods{ color:#307ECC; cursor:pointer}
.copy{ float:right;}
.click{ cursor:pointer}
</style>
<script src="js/jquery-3.2.1.min.js" type="text/javascript"></script>
<!--<script src="js/kftp.js" type="text/javascript"></script>-->
<script>
$(document).ready(function(){
	
	//初始化
	var address,stockSum = 0,goodsSum = 0,priceSum = 0.00,Split = false;
	var json = {"mobile":"13414141114"};//{"mobile":getQueryString('mobile')};
	var pramas = JSON.stringify(json);
	var url = "";//http://10.127.10.128:8080";
	
	$(".history").hide();
	$("#commend").hide();
	$(".isSplit").hide()
	$(".selStore").hide();
	$(".payCon").hide();
	$("input:radio[name='isSplit'][value=0]").attr("checked",true);
	$(".sure").hide();
//	$("#cause").attr('data-state','0')
//	$("#cause").hide();


	isSysVIP();
	
	//处理json
	//function changeJson(ob){
//		var json = JSON.stringify(ob).replace('null','""');
//		return JSON.parse(json)
//	}
	
	//根据手机号 判断是否是系统会员
	function isSysVIP(){
		$.ajax({  
			url: url+"/customercenter/isSysMemberByMobile",  
			type: "post",
			data: pramas,
			dataType: "json",
			contentType: "application/json",
			error: function(){
				console.log("error");
			},   
			success: function(data){
				console.log(data);
				if(data.success){
					infoVIP(data.memberId)
				}else{
					//隐藏信息展示按钮
					$("#con").hide();
					$(".btn1").show();
					regVIP();
					temVIP();
				}
			}
		}); 
	}
	
	//根据手机号 注册为系统会员
	function regVIP(){
		$("#register").click(function(e) {
			$.ajax({  
				url: url+"/customercenter/registerByMobile",  
				type: "post",
				data: pramas,
				dataType: "json",
				contentType: "application/json",
				error: function(){
					console.log("error");
				},   
				success: function(data){
					console.log(data);
					if(data.success){
						infoVIP(data.memberId)
					}else{
						alert("注册失败")
					}
				}
			}); 
		});
	}
	
	//临时客户
	function temVIP(){
		$("#temporary").click(function(e) {
			json = {"mobile":"13414141114"};
			pramas = JSON.stringify(json);
			infoVIP("13414141114")
		});
	}
	
	//基础信息查询
	function baseInfo(){
		$.ajax({  
			url: url+"/customercenter/getMemberInfoByMobile",  
			type: "post",
			data: pramas,
			dataType: "json",
			contentType: "application/json",
			error: function(){
				console.log("error");
			},   
			success: function(data){
				//data = changeJson(data);
				console.log(data);
				$(".baseInfmt").html('');
				$("#baseInfmt1").html('<tr>'+
											  '<td>会员手机：<input type="image" value="'+data.mobile+'" /></td>'+
											  '<td>会员姓名：<input type="image" value="'+data.nickName+'" /></td>'+
											  '<td>会员积分：<span>'+data.point+'</span></td>'+
										  '</tr>'+
										  '<tr>'+
											  '<td>会员生日：<input type="image" value="'+data.birthday+'" /></td>'+
											  '<td>会员性别：<input type="image" value="'+data.sexType+'" /></td>'+
											  '<td>会员等级：'+data.level+'</td>'+
										  '</tr>');
				$("#baseInfmt2").html('<tr>'+
											  '<td colspan="2">最近下单时间：<font color="#ff0000">'+data.lastPlaceOrderTime+'</font></td>'+
											  '<td>最近订单号：'+data.lastPlaceOrderId+'</td>'+
											  '<td>注册日期：'+data.regTime+'</td>'+
										  '</tr>'+
										  '<tr>'+
											  '<td>订单总数：'+data.placeOrderNum +'</td>'+
											  '<td>分组：'+data.groupNames+'</td>'+
											  '<td>消费总金额：￥'+data.consumptionOrderMoney+'</td>'+
											  '<td>注册渠道：'+data.channelType+'</td>'+
										  '</tr>');
				//修改基本信息 
				$(".baseInfmt input").click(function(e) {
					$(this).attr('type','text');
					$(this).blur(function(e) {
						$(this).attr('type','image');
					});
				});
				
			}
		}); 
	}
	
	//根据会员ID获取会员推荐商品
	function recommend(id){
		$.ajax({  
			url: url+"/customercenter/getMemberRecommendProductItem",  
			type: "post",
			data: id,
			dataType: "json",
			contentType: "application/json",
			error: function(){
				console.log("error");
			},   
			success: function(data){
				console.log(data);
				$("#commend tbody").html('');
				$.each(data, function(i, val){
					$("#commend tbody").append('<tr>'+
												'<td>'+val.base.name+' <span class="copy" onclick="copy(\''+val.base.name+'\')">复制</span></td>'+
											'</tr>');
				});
			}
		}); 
	}
	
	//根据会员ID获取会员地址列表
	function adList(id){
		$.ajax({  
			url: url+"/customercenter/getMemberAddressItem",  
			type: "post",
			data: id,
			dataType: "json",
			contentType: "application/json",
			error: function(){
				console.log("error");
			},   
			success: function(data){
				console.log(data);
				$("#adList").html('');
				$.each(data, function(i, val){
					$("#adList").append('<div class="adcon">'+
										'<div class="admsg">'+val.consigneeName+','+val.mobile+','+val.detailAddress+'</div>'+
										'<div class="adbtn">选择</div></div>');
				});
				
				//选择地址
				$(".adbtn").click(function(e) {
					address = $(this).prev().html();
					$(".selAd").removeClass('selAd');
					$(this).closest('.adcon').addClass('selAd');
					$("#conAd").html(address);
					//alert(address)
				});
			}
		}); 
	}
	
	//会员信息查询
	function infoVIP(id){
		var idJson = {"memberId":id};
		var idPramas = JSON.stringify(idJson);
		//展示信息隐藏按钮
		$("#con").show();
		$(".btn1").hide();
		//查询信息
		baseInfo();	
		recommend(idPramas);
		adList(idPramas)
	}
	
	//关键字模糊查询
	function goodsSearch(){
		var keyJson = {"keyword":$("#goodsName").val(),"categoryId":$("#categoryId").val(),"type":$("#type").val()};
		var keyPramas = JSON.stringify(keyJson);
		$.ajax({  
			url: url+"/customercenter/findProductBykeyword",  
			type: "post",
			data: keyPramas,
			dataType: "json",
			contentType: "application/json",
			error: function(){
				console.log("error");
			},   
			success: function(data){
				console.log(data);
				$("#goodsList tbody").html('');
				$.each(data, function(i, val){
					$("#goodsList tbody").append('<tr>'+
													'<th class="buy">购买</th>'+
													'<th>678990</th>'+
													'<th><div class="goodsName">53度飞天53度飞天茅台53度飞天茅台53度飞天茅台茅台500ml</div></th>'+
													'<th class="storeName">杏花岭二号库</th>'+
													'<th>32分钟</th>'+
													'<th>2.09</th>'+
													'<th class="stockSum">342</th>'+
													'<th class="goodsSum"><input class="buyNum" oninput="aaa(this)" value="1" /></th>'+
													'<th class="spec">6</th>'+
													'<th class="p1">150.50</th>'+
													'<th class="p2">95</th>'+
													'<th class="p3">94</th>'+
													'<th class="p4">96</th>'+
													'<th>能</th>'+
													'<th><select><option>1</option><option>1</option><option>1</option></select></th>'+
													'<th class="priceSum">100.00</th>'+
													'<th class="like">查看</th>'+
												'</tr>');
				});
				likeGoods();
				buy()      
			}
		}); 
	}
	
	//下单or历史订单
	$(".btn2").click(function(e) {
        $(".selbtn2").removeClass('selbtn2');
		$(this).addClass('selbtn2');
		if($(this).attr('data-id') == 1){
			$(".order").show();
			$(".history").hide();
		}else{
			$(".order").hide();
			$(".history").show();
		}
    });
	///相似商品
	function likeGoods(){
		$(".like").click(function(e) {
			$("#likeGoods").show();
			
		});
		$("#closeLG").click(function(e) {
			$("#likeGoods").hide();
		});
    }
	//打开地图
	$("#addAD").click(function(e) {
		$("#map").show();
    });
	$("#closeMap").click(function(e) {
		$("#map").hide();
	});
	
	//购买过or推荐
	$(".title3").click(function(e) {
        $(".title3").removeClass('selT3');
		$(this).addClass('selT3');
		if($(this).attr('data-id') == 1){
			$("#sold").show();
			$("#commend").hide();
		}else{
			$("#sold").hide();
			$("#commend").show();
		}
    });
	
	//购买
	function buy(){
		$(".buy").click(function(e) {
			var str = $(this).closest('tr').prop("outerHTML").replace('<th class="buy">购买</th>','');
			str = str.replace('<th class="like">查看</th>','<th class="del">删除</th');
			$("#shopcar tbody").append(str);
			//购物车内删除该商
			$(".del").click(function(e) {
				$(this).closest('tr').remove();
				isSplit();
				sum()
			});
			isSplit();
			sum();
		});
			
	}
	
	//合计
	function sum(){
		stockSum = 0,goodsSum = 0,priceSum = 0;
		$("#shopcar .stockSum").each(function(){
			stockSum += ($(this).html()-0)
		});
		$("#shopcar .goodsSum input").each(function(){
			goodsSum += ($(this).val()-0)
		});
		$("#shopcar .priceSum").each(function(){
			priceSum += ($(this).html()-0)
		});
		$("#stockSum").html(stockSum);
		$("#goodsSum").html(goodsSum);
		$("#priceSum").html(priceSum)
	}
	
	//是否拆单
	function isSplit(){
		var i = true,store,time,state = true;
		$("#shopcar .storeName").each(function(){
			if(i){
				store = $(this).html();
				time = $(this).next().html();
				i = false;
				$(".isSplit").hide();
			}else{
				if(state){
					if(store != $(this).html() || time != $(this).next().html()){
						$(".isSplit").show();
						state = false;
					}else{
						$(".isSplit").hide();
						$("input:radio[name='isSplit'][value=0]").attr("checked",true);
						Split = false;
					}
				}
			}	
		});
	}
	$(".isSplit input").click(function(e) {
    	if($(this).attr('value') == 1)Split = true;
		else Split = false;
    });
	
	//清空购物车
	$("#cleanCar").click(function(e) {
        $("#shopcar tbody").html('');
		$(".selStore").html('');
        $(".selStore").hide();
		$(".isSplit").hide();
		$("input:radio[name='isSplit'][value=0]").attr("checked",true);
		Split = false;
		sum()
    });
	
	//推荐门店&结算&关单
	$("#selStore").click(function(e) {
		$(".selStore").html();
        $(".selStore").show();
    });
	$(".pay").click(function(e) {
		var str = '';
		$("#shopcar .storeName").each(function() {
			var str2 = $(this).html()+"("+ $(this).next().html()+","+ $(this).next().next().html() +") ";
			var test = new RegExp(str2);
			if(!(str.indexOf(str2)>=0)){
				if(Split)str +=str2;
				else str = str2	
			}
		});
		console.log(str);
		$("#conStore").html(str);
		$("#conPrice").html("￥"+$("#priceSum").html());
        $(".payCon").show();
		$(".sure").show();
    });
	
	//关单 or 确认下单
	$("#close").click(function(e) {
        if(confirm("确认关单")){}
    });
	$("#sure").click(function(e) {
        if(confirm("信息已验证完毕")){}
    });
	
	//$("#close").click(function(e) {
//        if( $("#cause").attr('data-state') == 1 ){
//			$("#cause").hide();
//			$("#cause").attr('data-state','0')
//		}else{
//			$("#cause").show();
//			$("#cause").attr('data-state','1')
//		} 
//    });

	//历史订单查看详情
	$(".oCTit").click(function(e) {
        $(".seloCTit").removeClass(".seloCTit");
		$(this).addClass('.seloCTit')
    });
	$('.look').click(function(e) {
		if( $(this).attr('data-state') == 0){
			$(this).closest('tr').next().show();
			$(this).html('收起');
			$(this).attr('data-state','1')
		}else{
			$(this).closest('tr').next().hide();
			$(this).html('查看');
			$(this).attr('data-state','0')
		}
    });

	
});

//获取url
function getQueryString(name) { 
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r != null) return unescape(r[2]); return null; 
}
</script>
</head>

<body>
<div class="title">
	会员中心
	<div class="btn btn1 selbtn1" id="register">注册会员</div>
	<div class="btn btn1" id="temporary">临时客户</div>
</div>
<div id="con">
    <div>
        <table class="baseInfmt" id="baseInfmt1">
            <tr>
                <td>会员手机：<input type="image" value="13934491077" /></td>
                <td>会员姓名：<input type="image" value="张先生" /></td>
                <td>会员积分：<span>0</span></td>
            </tr>
            <tr>
                <td>会员生日：<input type="image" value="1990-01-01" /></td>
                <td>会员性别：<input type="image" value="男" /></td>
                <td>会员等级：V1</td>
            </tr>
        </table>
        <table class="baseInfmt" id="baseInfmt2" style="margin-left:2%">
            <tr>
                <td colspan="2">最近下单时间：<font color="#ff0000">2017-10-21 20:00:00</font></td>
                <td>最近订单号：1234567890</td>
                <td>注册日期：2017-10-21</td>
            </tr>
            <tr>
                <td>订单总数：10</td>
                <td>分组：重要价值客户</td>
                <td>消费总金额：￥5000.00</td>
                <td>注册渠道：APP</td>
            </tr>
        </table>
    </div>
    <div class="con">
        <div class="tab">
            <div class="btn2 selbtn2" data-id="1">下单</div>
            <div class="btn2" data-id="2">历史订单</div>
        </div>
        <div class="order">
            <div class="">
                <div class="shopAd">
                <div class="title2">会员收货地址</div>
                <div class="saSearch">
                    <input class="sAd" />
                    <span class="btn btn3">搜索</span>
                    <span class="btn btn3" id="addAD">添加地址</span>
                </div>
                <div class="adList" id="adList">
                    <div class="adcon">
                        <div class="admsg">张先生1，13013001300，山西省太原市杏花岭区万达广场……………………………………………………</div>
                        <div class="adbtn">选择</div>
                    </div>
                    <div class="adcon">
                        <div class="admsg">张先生2，13013001300，山西省太原市杏花岭区万达广场……………………………………………………</div>
                        <div class="adbtn">选择</div>
                    </div>
                    <div class="adcon">
                        <div class="admsg">张先生3，13013001300，山西省太原市杏花岭区万达广场……………………………………………………</div>
                        <div class="adbtn">选择</div>
                    </div>
                    <div class="adcon">
                        <div class="admsg">张先生4，13013001300，山西省太原市杏花岭区万达广场……………………………………………………</div>
                        <div class="adbtn">选择</div>
                    </div>
                </div>
            </div>
            <div class="goodsBox">
                <div class="title2 title3 selT3" data-id="1">购买过的商品</div>
                <div class="title2 title3" data-id="2">推荐商品</div>
                <div class="t3box">
                    <table id="sold" class="tbbox">
                        <thead>
                            <th>商品名称</th>
                            <th>下单时间</th>
                            <th>数量</th>
                            <th>购买价</th>
                            <th>消费门店</th>
                        </thead>
                        <tbody>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                                <th>2017-10-21 00:00:00</th>
                                <th>1</th>
                                <th>20</th>
                                <th class="storeName">杏花岭一号库</th>
                            </tr>
                        </tbody>
                    </table>
                    <table id="commend" class="tbbox">
                        <thead>
                            <th>商品名称</th>
                        </thead>
                        <tbody>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                            </tr>
                            <tr>
                                <td>53度飞天茅台500ml <span class="copy" onclick="copy('123')">复制</span></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            </div>
    <input id="copy" value="" style=" opacity:0; width:0; height:0" />
            <!--添加商品-->
            <div class="addGoods">
                <div class="title2">添加商品</div>
                <div class="addSearch">
                    <span class="key">
                        <div class="keylist">
                            <input id="goodsName" oninput="keySearch(value)" placeholder="商品名称" />
                            <div class="words">11111111111111111111111111</div>
                            <div class="words">2</div>
                            <div class="words">3</div>
                            <div class="words">4</div>
                        </div>
                    </span>
                    <span>品类：<select id="categoryId"><option>1</option><option>1</option><option>1</option></select></span>
                    <span>类型：<select id="type"><option>1</option><option>1</option><option>1</option></select></span>
                    <span>产地：<select><option>1</option><option>1</option><option>1</option></select></span>
                    <span>品牌：<select><option>1</option><option>1</option><option>1</option></select></span>
                    <span>是否为定向：<select><option>1</option><option>1</option><option>1</option></select></span>
                    <span>规格：<select><option>1</option><option>1</option><option>1</option></select></span>
                    <span>是否带包装：<select><option>1</option><option>1</option><option>1</option></select></span>
                    <span>价格：<input /> - <input /></span>
                    <span id="clean" class="btn btn3">清空</span>
                    <span id="goodsSearch" class="btn btn3" onclick="goodsSearch()">搜索</span>
                </div>
                <div>
                    <table id="goodsList" class="tbbox">
                        <thead>
                            <th>选购</th>
                            <th>商品编号</th>
                            <th>商品名称</th>
                            <th>门店名称</th>
                            <th>配送时间</th>
                            <th class="click">距离km↑</th>
                            <th class="click">库存↓</th>
                            <th>购买数量</th>
                            <th>箱规</th>
                            <th>会员价</th>
                            <th>整箱单瓶价</th>
                            <th>电子钱包价</th>
                            <th>促销价</th>
                            <th>发物流</th>
                            <th>商品活动</th>
                            <th>小计</th>
                            <th>相似品</th>
                        </thead>
                        <tbody>
                            <tr>
                                <th class="buy">购买</th>
                                <th>678990</th>
                                <th><div class="goodsName">53度飞天53度飞天茅台53度飞天茅台53度飞天茅台茅台500ml</div></th>
                                <th class="storeName">杏花岭二号库</th>
                                <th>32分钟</th>
                                <th>2.09</th>
                                <th class="stockSum">342</th>
                                <th class="goodsSum"><input class="buyNum" oninput="aaa(this)" value="1" /></th>
                                <th class="spec">6</th>
                                <th class="p1">150.50</th>
                                <th class="p2">95</th>
                                <th class="p3">94</th>
                                <th class="p4">96</th>
                                <th>能</th>
                                <th><select><option>1</option><option>1</option><option>1</option></select></th>
                                <th class="priceSum">100.00</th>
                                <th class="like">查看</th>
                            </tr>
                            <tr>
                                <th class="buy">购买</th>
                                <th>678990</th>
                                <th><div class="goodsName">53度飞天茅台500ml</div></th>
                                <th class="storeName">杏花岭一号库</th>
                                <th>32分钟</th>
                                <th>9.09</th>
                                <th class="stockSum">34</th>
                                <th class="goodsSum"><input class="buyNum" oninput="aaa(this)"  value="1" /></th>
                                <th class="spec">6</th>
                                <th class="p1">150.50</th>
                                <th class="p2">95</th>
                                <th class="p3">94</th>
                                <th class="p4">96</th>
                                <th>能</th>
                                <th><select><option>1</option><option>1</option><option>1</option></select></th>
                                <th class="priceSum">100.00</th>
                                <th class="like">查看</th>
                            </tr>
                            <tr>
                                <th class="buy">购买</th>
                                <th>678990</th>
                                <th><div class="goodsName">53度飞天茅台500ml</div></th>
                                <th class="storeName">杏花岭三号库</th>
                                <th>13分钟</th>
                                <th>9.09</th>
                                <th class="stockSum">34</th>
                                <th class="goodsSum"><input class="buyNum" oninput="aaa(this)"  value="1" /></th>
                                <th class="spec">6</th>
                                <th class="p1">150.50</th>
                                <th class="p2">95</th>
                                <th class="p3">94</th>
                                <th class="p4">96</th>
                                <th>能</th>
                                <th><select><option>1</option><option>1</option><option>1</option></select></th>
                                <th class="priceSum">100.00</th>
                                <th class="like">查看</th>
                            </tr>
                            <tr>
                                <th class="buy">购买</th>
                                <th>678990</th>
                                <th><div class="goodsName">53度飞天茅台500ml</div></th>
                                <th class="storeName">杏花岭一号库</th>
                                <th>3分钟</th>
                                <th>9.09</th>
                                <th class="stockSum">34</th>
                                <th class="goodsSum"><input class="buyNum" oninput="aaa(this)"  value="1" /></th>
                                <th class="spec">6</th>
                                <th class="p1">150.50</th>
                                <th class="p2">95</th>
                                <th class="p3">94</th>
                                <th class="p4">96</th>
                                <th>能</th>
                                <th><select><option>1</option><option>1</option><option>1</option></select></th>
                                <th class="priceSum">100.00</th>
                                <th class="like">查看</th>
                            </tr>
                            <tr>
                                <th class="buy">购买</th>
                                <th>678990</th>
                                <th><div class="goodsName">53度飞天茅台500ml</div></th>
                                <th class="storeName">杏花岭一号库</th>
                                <th>3分钟</th>
                                <th>9.09</th>
                                <th class="stockSum">34</th>
                                <th class="goodsSum"><input class="buyNum" oninput="aaa(this)"  value="1" /></th>
                                <th class="spec">6</th>
                                <th class="p1">150.50</th>
                                <th class="p2">95</th>
                                <th class="p3">94</th>
                                <th class="p4">96</th>
                                <th>能</th>
                                <th><select><option>1</option><option>1</option><option>1</option></select></th>
                                <th class="priceSum">100.00</th>
                                <th class="like">查看</th>
                            </tr>
                            <tr>
                                <th class="buy">购买</th>
                                <th>678990</th>
                                <th><div class="goodsName">53度飞天茅台500ml</div></th>
                                <th class="storeName">杏花岭一号库</th>
                                <th>3分钟</th>
                                <th>9.09</th>
                                <th class="stockSum">34</th>
                                <th class="goodsSum"><input class="buyNum" oninput="aaa(this)"  value="1" /></th>
                                <th class="spec">6</th>
                                <th class="p1">150.50</th>
                                <th class="p2">95</th>
                                <th class="p3">94</th>
                                <th class="p4">96</th>
                                <th>能</th>
                                <th><select><option>1</option><option>1</option><option>1</option></select></th>
                                <th class="priceSum">100.00</th>
                                <th class="like">查看</th>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--购物车-->
            <div class="addGoods">
                <div class="title2">购物车</div>
                <div>
                    <table id="shopcar" class="tbbox">
                        <thead>
                            <th>商品编号</th>
                            <th>商品名称</th>
                            <th>门店名称</th>
                            <th>配送时间</th>
                            <th class="click">距离km↑</th>
                            <th class="click">库存↓</th>
                            <th>购买数量</th>
                            <th>箱规</th>
                            <th>会员价</th>
                            <th>整箱单瓶价</th>
                            <th>电子钱包价</th>
                            <th>促销价</th>
                            <th>发物流</th>
                            <th>商品活动</th>
                            <th>小计</th>
                            <th>操作</th>
                        </thead>
                        <tbody>
                            
                        </tbody>
                        <tfoot>
                            <tr>
                                <th>合计</th>
                                <th colspan="4"></th>
                                <th id="stockSum">0</th>
                                <th id="goodsSum">0</th>
                                <th colspan="7"></th>
                                <th id="priceSum">0.00</th>
                                <th></th>
                            </tr>
                        </tfoot>
                    </table>
                </div>
                <div class="buyCon">
                    <span class="isSplit">是否拆单：<input name="isSplit" type="radio" value="1" /> 是 <input name="isSplit" type="radio" value="0" /> 否</span>
                    <span class="selStore">配送门店：一号店 0.9km</span>
                    <span id="selStore" class="btn btn3">推荐配送门店</span>
                    <span id="cleanCar" class="btn btn3">清空购物车</span>
                    <span class="btn btn3 pay">结算</span>
                </div>
            </div>
            <!--支付信息-->
            <div class="payCon">
                <div class="title2">支付信息</div>
                <div>
                    <table id="payCon" class="tbbox">
                        <tbody>
                            <tr>
                                <td class="conTit">支付方式:</td>
                                <td width="30%">
                                    <select>
                                        <option value="支付宝">支付宝</option>
                                        <option value="微信">微信</option>
                                        <option value="银行卡">银行卡</option>
                                        <option selected="" value="电子钱包">电子钱包</option>
                                        <option value="现金">现金</option>
                                    </select>
                                    <span>已开通</span> 余额：<span>500.00</span>
                                </td>
                                <td class="conTit">收货信息:</td>
                                <td id="conAd">张先生，13013001300，山西省太原市杏花岭区万达广场</td>
                            </tr>
                            <tr>
                                <td class="conTit">可参与活动:</td>
                                <td width="30%">
                                    <select>
                                        <option value="">选择优惠活动</option>
                                    </select>
                                </td>
                                <td class="conTit">配送门店:</td>
                                <td id="conStore">杏花岭一号库（19分钟，1.0km）杏花岭二号库（12小时发，3.0km）</td>
                            </tr>
                            <tr>
                                <td class="conTit">可用优惠券:</td>
                                <td width="30%">
                                    <select>
                                        <option value="">选择优惠券</option>
                                    </select>
                                </td>
                                <td class="conTit">商品合计:</td>
                                <td id="conPrice">￥.00</td>
                            </tr>
                            <tr>
                                <td class="conTit">配送方式:</td>
                                <td width="30%">
                                    <select>
                                        <option value="">同城配送</option>
                                        <option value="">门店自提</option>
                                        <option value="">快递</option>
                                    </select>
                                </td>
                                <td class="conTit">运费:</td>
                                <td>￥.00</td>
                            </tr>
                            <tr>
                                <td class="conTit">配送优先级:</td>
                                <td width="30%">
                                    <select>
                                        <option value="">预约送</option>
                                        <option value="">普通送</option>
                                        <option value="">闪送</option>
                                    </select>
                                    <select>
                                        <option value="">选择预约到达时间</option>
                                    </select>
                                </td>
                                <td class="conTit">优惠:</td>
                                <td>-￥.00</td>
                            </tr>
                            <tr>
                                <td class="conTit">卖家备注:</td>
                                <td width="30%">
                                    <input />
                                </td>
                                <td class="conTit">合计:</td>
                                <td>￥.00</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--关单or下单-->
            <div class="sure">
                <span id="cause">关单原因：
                    <select><option>库存不满足</option><option>不愿意拆单</option><option>不愿意等</option></select>
                    备注<input id="remark"/>
                </span>
                <span id="close" class="btn btn3">关单</span>
                <span id="sure" class="btn btn3">确认下单</span>
            </div>
        </div>
        <div class="history">
            <div><input class="h_search" placeholder="收货人/会员手机号" /></div>
            <div>
                <table class="h_table">
                    <thead>
                        <tr>
                            <th>订单编号</th>
                            <th>下单时间</th>
                            <th>要求送达时间</th>
                            <th>订单状态</th>
                            <th>收货人</th>
                            <th>收货地址</th>
                            <th>订单金额</th>
                            <th>付款方式</th>
                            <th>商品数量</th>
                            <th>查看</th>
                        </tr>
                    </thead>
                    <tr>
                        <th>1234567890111     <span class="copy" onclick="copy('123')">复制</span></th>
                        <th>2017-11-11 20:00:00</th>
                        <th>2017-11-11 20:20:00</th>
                        <th>未支付</th>
                        <th>张国杰</th>
                        <th>山西省太原市万达广场</th>
                        <th>100</th>
                        <th>货到付款</th>
                        <th>3</th>
                        <th class="look" data-state="0">查看</th>
                    </tr>
                    <tr class="orderConTr">
                        <th colspan="10">
                            <div class="orderCon">
                                <div class="oCTitList">
                                    <div class="oCTit seloCTit">订单基本信息</div>
                                    <div class="oCTit">商品信息</div>
                                    <div class="oCTit">商品拆分信息</div>
                                    <div class="oCTit">优惠信息</div>
                                    <div class="oCTit">支付信息</div>
                                    <div class="oCTit">收货人信息</div>
                                    <div class="oCTit">会员信息</div>
                                    <div class="oCTit">出库信息</div>
                                    <div class="oCTit">退货信息</div>
                                    <div class="oCTit">退款信息</div>
                                    <div class="oCTit">配送信息</div>
                                    <div class="oCTit">发票信息</div>
                                    <div class="oCTit">订单转支付信息</div>
                                    <div class="oCTit">操作记录</div>
                                </div>
                                <div>
                                    <table>
                                        <tr>
                                            <td>订单来源</td>
                                            <td>APP</td>
                                            <td>商品总金额</td>
                                            <td>123.0</td>
                                            <td>会员帐号</td>
                                            <td>00000001</td>
                                        </tr>
                                        <tr>
                                            <td>订单编号</td>
                                            <td>98772618890</td>
                                            <td>商品优惠金额</td>
                                            <td>123.0</td>
                                            <td>会员姓名</td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td>下单时间</td>
                                            <td>2017-11-11 12:00:00</td>
                                            <td>订单优惠金额</td>
                                            <td>123.0</td>
                                            <td>会员手机号</td>
                                            <td>00000001</td>
                                        </tr>
                                        <tr>
                                            <td>配送优先级</td>
                                            <td>立即送</td>
                                            <td>平台优惠金额</td>
                                            <td>否</td>
                                            <td>会员等级</td>
                                            <td>1</td>
                                        </tr>
                                        <tr>
                                            <td>配送门店</td>
                                            <td>001</td>
                                            <td>配送费用</td>
                                            <td>123.0</td>
                                            <td>收货人姓名</td>
                                            <td>收货</td>
                                        </tr>
                                        <tr>
                                            <td>门店名称</td>
                                            <td>一号库</td>
                                            <td>订单总金额</td>
                                            <td>123.0</td>
                                            <td>收货人电话</td>
                                            <td>00000001</td>
                                        </tr>
                                        <tr>
                                            <td>配送方式</td>
                                            <td>门店自配送</td>
                                            <td>已支付金额</td>
                                            <td>123.0</td>
                                            <td>收货人地址</td>
                                            <td>解放北路万达广场</td>
                                        </tr>
                                        <tr>
                                            <td>要求送达时间</td>
                                            <td>2017-11-11 12:00:0</td>
                                            <td>下单人</td>
                                            <td>范德萨</td>
                                            <td>进入中台时间</td>
                                            <td>2017-11-11 12:00:0</td>
                                        </tr>
                                        <tr>
                                            <td>下单人工号</td>
                                            <td>3321</td>
                                            <td>用户备注</td>
                                            <td>123.0</td>
                                            <td>卖家备注</td>
                                            <td>00000001</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </th>
                    </tr>
                    <tr>
                        <th>1234567890111     <span class="copy" onclick="copy('123')">复制</span></th>
                        <th>2017-11-11 20:00:00</th>
                        <th>2017-11-11 20:20:00</th>
                        <th>未支付</th>
                        <th>张国杰</th>
                        <th>山西省太原市万达广场</th>
                        <th>￥100</th>
                        <th>货到付款</th>
                        <th>3</th>
                        <th class="look" data-state="0">查看</th>
                    </tr>
                    <tr class="orderConTr">
                        <th colspan="10">
                            <div class="orderCon">
                                <div class="oCTitList">
                                    <div class="oCTit seloCTit">订单基本信息</div>
                                    <div class="oCTit">商品信息</div>
                                    <div class="oCTit">商品拆分信息</div>
                                    <div class="oCTit">优惠信息</div>
                                    <div class="oCTit">支付信息</div>
                                    <div class="oCTit">收货人信息</div>
                                    <div class="oCTit">会员信息</div>
                                    <div class="oCTit">出库信息</div>
                                    <div class="oCTit">退货信息</div>
                                    <div class="oCTit">退款信息</div>
                                    <div class="oCTit">配送信息</div>
                                    <div class="oCTit">发票信息</div>
                                    <div class="oCTit">订单转支付信息</div>
                                    <div class="oCTit">操作记录</div>
                                </div>
                                <div>
                                    <table>
                                        <tr>
                                            <td>订单来源</td>
                                            <td>APP</td>
                                            <td>商品总金额</td>
                                            <td>123.0</td>
                                            <td>会员帐号</td>
                                            <td>00000001</td>
                                        </tr>
                                        <tr>
                                            <td>订单编号</td>
                                            <td>98772618890</td>
                                            <td>商品优惠金额</td>
                                            <td>123.0</td>
                                            <td>会员姓名</td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td>下单时间</td>
                                            <td>2017-11-11 12:00:00</td>
                                            <td>订单优惠金额</td>
                                            <td>123.0</td>
                                            <td>会员手机号</td>
                                            <td>00000001</td>
                                        </tr>
                                        <tr>
                                            <td>配送优先级</td>
                                            <td>立即送</td>
                                            <td>平台优惠金额</td>
                                            <td>否</td>
                                            <td>会员等级</td>
                                            <td>1</td>
                                        </tr>
                                        <tr>
                                            <td>配送门店</td>
                                            <td>001</td>
                                            <td>配送费用</td>
                                            <td>123.0</td>
                                            <td>收货人姓名</td>
                                            <td>收货</td>
                                        </tr>
                                        <tr>
                                            <td>门店名称</td>
                                            <td>一号库</td>
                                            <td>订单总金额</td>
                                            <td>123.0</td>
                                            <td>收货人电话</td>
                                            <td>00000001</td>
                                        </tr>
                                        <tr>
                                            <td>配送方式</td>
                                            <td>门店自配送</td>
                                            <td>已支付金额</td>
                                            <td>123.0</td>
                                            <td>收货人地址</td>
                                            <td>解放北路万达广场</td>
                                        </tr>
                                        <tr>
                                            <td>要求送达时间</td>
                                            <td>2017-11-11 12:00:0</td>
                                            <td>下单人</td>
                                            <td>范德萨</td>
                                            <td>进入中台时间</td>
                                            <td>2017-11-11 12:00:0</td>
                                        </tr>
                                        <tr>
                                            <td>下单人工号</td>
                                            <td>3321</td>
                                            <td>用户备注</td>
                                            <td>123.0</td>
                                            <td>卖家备注</td>
                                            <td>00000001</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </th>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
<div id="likeGoods">
	<div class="title2" id="lGName">相似商品</div>
    <div class="lGTb">
    	<table id="lGTb" class="tbbox">
            <thead>
                <tr>
                	<th>商品名称</th>
                	<th>会员价</th>
                	<th>详情</th>
            	</tr>
            </thead>
            <tbody>
                <tr>
                    <td>53度飞天茅台500ml </td>
                    <th>299.00</th>
                    <th class="likeGoods">详情</th>
                </tr>
                <tr>
                    <td>53度飞天茅台500m</td>
                    <th>299.00</th>
                    <th class="likeGoods">详情</th>
                </tr>
                <tr>
                    <td>53度飞天茅台500ml </td>
                    <th>299.00</th>
                    <th class="likeGoods">详情</th>
                </tr>
                <tr>
                    <td>53度飞天茅台500</td>
                    <th>299.00</th>
                    <th class="likeGoods">详情</th>
                </tr>
                <tr>
                    <td>53度飞天茅台500ml</td>
                    <th>299.00</th>
                    <th class="likeGoods">详情</th>
                </tr>
                <tr>
                    <td>53度飞天茅台500ml</td>
                    <th>299.00</th>
                    <th class="likeGoods">详情</th>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="btn btn3" id="closeLG">关闭</div>
</div>
<style>
.mapCon table{ width:100%; font-size:13px;}
.mapCon table td{ padding:5px}
.mapCon table input,.mapCon table select{ border:1px solid #b2b2b2}
.mapCon table select{ width:100px}
.mapSearch{ width:500px; position:absolute; top:220px; left:100px; font-size:16px; box-shadow:5px 5px 5px #999}
.mapSearch input{ width:80%; border:0; display:inline-block; height:40px; line-height:40px; padding:0 5px}
.btnSearch{ width:20%; height:40px; line-height:40px; background:#307ECC; color:#fff; display:inline-block; text-align:center; cursor:pointer}
</style>
<div id="map">
	<!--<div class="title2" >选择地址</div>-->
    <div>
    	<div class="mapCon">
        	<table>
            	<tr style=" height:60px">
                	<td>收件人：</td>
                    <td><input /></td>
                	<td>收货人手机：</td>
                    <td><input /></td>
                	<td>地址类型：</td>
                    <td>
                    	<select>
                        	<option>家庭</option>
                        	<option>公司</option>
                        	<option>饭店</option>
                        	<option>其他</option>
                        </select>
                    </td>
                </tr>
            	<tr>
                	<td>收货地址：</td>
                    <td colspan="4">
                    	<select>
                        	<option>家庭</option>
                        	<option>公司</option>
                        	<option>饭店</option>
                        	<option>其他</option>
                        </select>
                    	<select>
                        	<option>家庭</option>
                        	<option>公司</option>
                        	<option>饭店</option>
                        	<option>其他</option>
                        </select>
                    	<select>
                        	<option>家庭</option>
                        	<option>公司</option>
                        	<option>饭店</option>
                        	<option>其他</option>
                        </select>
                    </td>
                	<td><div class="btn btn3" id="sureAD">添加</div></td>
                </tr>
            	<tr>
                	<td>详细地址：</td>
                    <td colspan="4">
                    	<input style=" width:100%" />
                    </td>
                	<td><div class="btn btn3" id="closeMap">关闭</div></td>
                </tr>
            </table>
        </div>
    </div>
    <div id="allmap">
    	
    </div>
    <div class="mapSearch">
    	<input id="conSearch" /><span class="btnSearch">搜索</span>
    </div>
</div>
<script>
	//单品计价
	function aaa(ob){
		var pob = $(ob).closest('th'),
		xg = $(pob).siblings('.spec').html()-0,
		hyj = $(pob).siblings('.p1').html()-0,
		zxdpj = $(pob).siblings('.p2').html()-0,
		dzqbj = $(pob).siblings('.p3').html()-0,
		cxj = $(pob).siblings('.p4').html()-0;
		
		if(ob.value < 1)ob.value = 1;
		if(ob.value > $(pob).siblings('.stockSum').html()-0)ob.value = $(pob).siblings('.stockSum').html()-0;
		$(ob).attr('value',ob.value);
		var zj = parseInt(ob.value/xg)*zxdpj*xg + ob.value%xg*hyj;
		$(pob).siblings('.priceSum').html(zj);
		
		//合计总价
		stockSum = 0,goodsSum = 0,priceSum = 0;
		$("#shopcar .stockSum").each(function(){
			stockSum += ($(this).html()-0)
		});
		$("#shopcar .goodsSum input").each(function(){
			goodsSum += ($(this).val()-0)
		});
		$("#shopcar .priceSum").each(function(){
			priceSum += ($(this).html()-0)
		});
		$("#stockSum").html(stockSum);
		$("#goodsSum").html(goodsSum);
		$("#priceSum").html(priceSum)
	}

	//添加商品检索名称
	$("#goodsName").focus(function(e) {
        $(".keylist").css('height','auto');
		$(".words").hover(function(e) {
			$("#goodsName").val($(this).html());
		});
		$("#goodsName").blur(function(e) {
            $(".keylist").css('height','30px')
        });
    });
	
	function keySearch(val){
		alert("edit wordslist")
	}
	$("#clean").click(function(e) {
        $(".addSearch select").val('');
        $(".addSearch input").val('');
    });
	
	//copy
	function copy(val){
		//console.log($(ob).html());
		$("#copy").val(val);
		var input = document.getElementById('copy');
		//input.focus();
		input.select();
		
		// 执行复制命令
		//document.execCommand('Copy');
		try{
			if(document.execCommand('copy', false, null)){
				//success info  成功了放些提示
			} else{
				//fail info   失败了放些提示
			}
		} catch(err){
			//fail info 失败了放些提示
		}
	}
	
	//$(".copy").click(function(e) {
//    	window.clipboardData.setData("text", '123');
//    });
</script>

<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=L3gfGpsqpWKGtYsVYrS4Wgz5"></script>
<script type="text/javascript">
	// 百度地图API功能
	
window.onload = function (){
	var map = new BMap.Map("allmap");  // 创建Map实例
	map.centerAndZoom("太原",15);
	
	//单击获取点击的经纬度
	map.addEventListener("click",function(e){
		alert(e.point.lng + "," + e.point.lat);
	});
	
	map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
	map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
}
	
</script>
</body>
</html>
